package com.ruoyi.order.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.SysTypeMapper;
import com.ruoyi.order.domain.SysType;
import com.ruoyi.order.service.ISysTypeService;

/**
 * 商品分类Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-02
 */
@Service
public class SysTypeServiceImpl implements ISysTypeService 
{
    @Autowired
    private SysTypeMapper sysTypeMapper;

    /**
     * 查询商品分类
     * 
     * @param typeId 商品分类主键
     * @return 商品分类
     */
    @Override
    public SysType selectSysTypeByTypeId(Long typeId)
    {
        return sysTypeMapper.selectSysTypeByTypeId(typeId);
    }

    /**
     * 查询商品分类列表
     * 
     * @param sysType 商品分类
     * @return 商品分类
     */
    @Override
    public List<SysType> selectSysTypeList(SysType sysType)
    {
        return sysTypeMapper.selectSysTypeList(sysType);
    }

    /**
     * 新增商品分类
     * 
     * @param sysType 商品分类
     * @return 结果
     */
    @Override
    public int insertSysType(SysType sysType)
    {
        sysType.setCreateTime(DateUtils.getNowDate());
        return sysTypeMapper.insertSysType(sysType);
    }

    /**
     * 修改商品分类
     * 
     * @param sysType 商品分类
     * @return 结果
     */
    @Override
    public int updateSysType(SysType sysType)
    {
        sysType.setUpdateTime(DateUtils.getNowDate());
        return sysTypeMapper.updateSysType(sysType);
    }

    /**
     * 批量删除商品分类
     * 
     * @param typeIds 需要删除的商品分类主键
     * @return 结果
     */
    @Override
    public int deleteSysTypeByTypeIds(Long[] typeIds)
    {
        return sysTypeMapper.deleteSysTypeByTypeIds(typeIds);
    }

    /**
     * 删除商品分类信息
     * 
     * @param typeId 商品分类主键
     * @return 结果
     */
    @Override
    public int deleteSysTypeByTypeId(Long typeId)
    {
        return sysTypeMapper.deleteSysTypeByTypeId(typeId);
    }
}
